package com.ruoyi.smartcity.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smartcity.traffic.mapper.TrafficRoadInformationMapper;
import com.ruoyi.smartcity.traffic.domain.TrafficRoadInformation;
import com.ruoyi.smartcity.traffic.service.ITrafficRoadInformationService;

/**
 * 道路信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-24
 */
@Service
public class TrafficRoadInformationServiceImpl implements ITrafficRoadInformationService 
{
    @Autowired
    private TrafficRoadInformationMapper trafficRoadInformationMapper;

    /**
     * 查询道路信息
     * 
     * @param id 道路信息主键
     * @return 道路信息
     */
    @Override
    public TrafficRoadInformation selectTrafficRoadInformationById(Long id)
    {
        return trafficRoadInformationMapper.selectTrafficRoadInformationById(id);
    }

    /**
     * 查询道路信息列表
     * 
     * @param trafficRoadInformation 道路信息
     * @return 道路信息
     */
    @Override
    public List<TrafficRoadInformation> selectTrafficRoadInformationList(TrafficRoadInformation trafficRoadInformation)
    {
        return trafficRoadInformationMapper.selectTrafficRoadInformationList(trafficRoadInformation);
    }

    /**
     * 新增道路信息
     * 
     * @param trafficRoadInformation 道路信息
     * @return 结果
     */
    @Override
    public int insertTrafficRoadInformation(TrafficRoadInformation trafficRoadInformation)
    {
        trafficRoadInformation.setCreateTime(DateUtils.getNowDate());
        return trafficRoadInformationMapper.insertTrafficRoadInformation(trafficRoadInformation);
    }

    /**
     * 修改道路信息
     * 
     * @param trafficRoadInformation 道路信息
     * @return 结果
     */
    @Override
    public int updateTrafficRoadInformation(TrafficRoadInformation trafficRoadInformation)
    {
        trafficRoadInformation.setUpdateTime(DateUtils.getNowDate());
        return trafficRoadInformationMapper.updateTrafficRoadInformation(trafficRoadInformation);
    }

    /**
     * 批量删除道路信息
     * 
     * @param ids 需要删除的道路信息主键
     * @return 结果
     */
    @Override
    public int deleteTrafficRoadInformationByIds(Long[] ids)
    {
        return trafficRoadInformationMapper.deleteTrafficRoadInformationByIds(ids);
    }

    /**
     * 删除道路信息信息
     * 
     * @param id 道路信息主键
     * @return 结果
     */
    @Override
    public int deleteTrafficRoadInformationById(Long id)
    {
        return trafficRoadInformationMapper.deleteTrafficRoadInformationById(id);
    }

    @Override
    public Long count() {
        return trafficRoadInformationMapper.count();
    }
}
